package com.mallcloud.mall.mall.api.entity.dto;

import com.mallcloud.mall.common.core.constant.enums.mall.PointsProductEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Optional;

@ApiModel(value="ProRedeemCoupon",description="积分兑换券过程对象")
@Data
@ToString
public class ProRedeemCoupon {

	@ApiModelProperty(value="会员卡号")
	private String cardNo;
	@ApiModelProperty(value="门店号")
	private String storeNo;
	/**
	 * {@link PointsProductEnum.RedeemTypeEnum}
	 */
	@ApiModelProperty(value="兑换类别 1、积分兑换，2、积分+钱的方式兑换")
	private String redeemType;
	@ApiModelProperty(value="档期")
	private String scheduleId;
	@ApiModelProperty(value="券种")
	private String type;
	@ApiModelProperty(value="兑换积分")
	private String redeemPoints;
	@ApiModelProperty(value="兑换电子券的总金额")
	private String redeemAmount;
	@ApiModelProperty(value="券兑换数量")
	private String num;
	@ApiModelProperty(value="兑换说明，兑换实物券为兑换名称")
	private String memo;
	
	@ApiModelProperty(value="返回执行编码",hidden=true)
	private Integer messageId;
	@ApiModelProperty(value="返回提示信息",hidden=true)
	private String message;
	@ApiModelProperty(value=" ",hidden=true)
	private String tktvipno;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
